from sys import exit
try:
    temp = input()
    temp_unit = input().upper()
    height = input()
    height_unit = input().upper()
except:
    print('wrong input!')
    exit()
if not temp.isdigit() or not height.isdigit():
    print("wrong input!")
    exit()
if temp_unit not in ('F', 'C'):
    print("wrong input!")
    exit()
if height_unit not in ('M', 'FT'):
    print("wrong input!")
    exit()

temp = float(temp)
height = float(height)
if temp_unit == 'F':
    temp_c = (temp - 32)*5 / 9
else:
    temp_c = temp
if height_unit == 'FT':
    height_m = height * 0.3048
else:
    height_m = height
boiling_point = 100 - (height_m / 300)
if temp_c <= 0:
    print("solid")
elif temp_c < boiling_point:
    print("liquid")
else:
    print("gaseous")